package yqt.com.cnki.service.impl;


import haha.life.common.CutPageBean;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import yqt.com.cnki.bo.ZSFWBo;
import yqt.com.cnki.dao.IZSFWDao;
import yqt.com.cnki.po.ZSFWPo;
import yqt.com.cnki.service.IZSFWService;

import java.util.List;

/**
 * Description:
 *
 * @author BaiGe
 * @date: 2021/11/11 15:56
 * @Version 1.0
 */
@Service
public class ZSFWServiceImpl implements IZSFWService {
    @Autowired
    private IZSFWDao zsfwDao;

    @Override
    public List<ZSFWPo> getZSFWByTableName_LimitFive(ZSFWPo zsfwPo) {
        return zsfwDao.getZSFWByTableName_LimitFive(zsfwPo);
    }

    @Override
    public List<ZSFWPo> getCNKIResource_LimitFive(ZSFWBo zsfwBo) {
        return zsfwDao.getCNKIResource_LimitFive(zsfwBo);
    }

    @Override
    public CutPageBean<ZSFWPo> getCNKIResource(ZSFWBo zsfwBo) {
        CutPageBean<ZSFWPo> cutPageBean=new CutPageBean<>();
        List<ZSFWPo> list = zsfwDao.getCNKIResource_List(zsfwBo);
        int num= (int) zsfwDao.getCNKIResource_Count(zsfwBo);
        cutPageBean.initCutPage(num, zsfwBo.getPageSize(), list);
        return cutPageBean;
    }

    @Override
    public List<ZSFWPo> getCNKIResourceIndex(ZSFWBo zsfwBo) {
        return null;
    }
}
